/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin			*/
/*	Project:	GlbCloud			*/
/*	Author:		gong_libin			*/
/*	Date:		2012_02_11			*/
/*	File:		MrMember.h			*/
/********************************************************/

#ifndef _MRMMRBER_H
#define	_MRMMRBER_H

#include "MrThread.h"
#include "MrCdLock.h"

#define	MR_IDLE			0x00
#define	MR_BUSY			0x01

class CMrMember : public CMrThread
{
public:
	CMrMember();
	virtual ~CMrMember();

	void MrMemberLock();
	void MrMemberWait();
	void MrMemberSignal();
	void MrMemberUnlock();
	void* MrMemberGetKey();
	UCHAR MrMemberGetStatus();
	int MrMemberAssign(void* pKey);
	void MrMemberSetKey(void* pKey);
	void MrMemberSetStatus(UCHAR ucStatus);

private:
	void* m_pKey;
	UCHAR m_ucStatus;
	pthread_cond_t m_stCond;
	pthread_mutex_t m_stLock;

};

#endif /* _MRMMRBER_H */
